<!DOCTYPE >
<html lang="zh-cn">
<head>
		<title>后台管理-功能</title>
    <% include ../partials/head %>
    <script type="text/javascript">
        oAdd={
            operation:function(){
                $("#find").on("click",function(){
                    $this=$(this);
                    $.post("/admin/recommendUser/find",{
                        objectId:$.trim($("#pocketId").val())
                    },function(json){
                        if(json.code==0){
                            $(".userView").html(json.data.name);
                            $(".userView")[0].href=window.location.origin+"/admin/userInfo?userId="+json.data.userId;
                            $("#user").val(json.data.userId);
                        }else{
                            alert(json.msg);
                        }
                    },"json")
                })
            },
            init:function(){
                this.operation();
            }
        }
        $(document).ready(function(){
            oAdd.init();
        })
    </script>
</head>
<body>
	<header>
    <% include ../partials/header %>
  </header>
  <div class="ch-container">
    <div class="row">
      <% include ../partials/sidebar %>
      <!-- 页面内容 -->
      <div id="content" class="col-lg-10 col-sm-10">
        <div class="row">
          <ul class="breadcrumb">
            <li>
                <a href="/admin/recommendUser">推荐用户管理</a>
            </li>
            <li>
                <a href="">新增</a>
            </li>
          </ul>
        </div>

        <% if (typeof errMsg != "undefined") { %>
        <div class="alert alert-danger">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            <strong><%= errMsg %></strong>
        </div>
        <% } %>

        <div class="row">
          <div class="box col-md-12">
            <div class="box-inner">
              <div class="box-header well" data-original-title="">
                <h2><i class="glyphicon glyphicon-edit"></i> 新增推荐用户 </h2>
              </div>

              <div class="box-content">

                <form role="form" method="post" enctype="multipart/form-data" action="/admin/recommendUser/add">

                  <div class="form-group">
                      <label >查找用户:（输入口袋ID）</label>
                      <input rows="5" class="form-control" id="pocketId" placeholder="输入口袋ID"></textarea>
                      <span class="btn btn-success" id="find" ><i class="glyphicon glyphicon-search"></i>查找</span>
                      <a href="" target="_blank" class="userView"></a>
                      <input rows="5" style="display:none" name="userId" class="form-control" id="user" placeholder="输入用户介绍"></textarea>
                  </div>
                  <button class="btn btn-success" id="saveUser" type="submit"><i class="glyphicon glyphicon-shopping-cart"></i>保存</button>
                </form>
              </div>

            </div>
          </div>
        </div>
      </div>

    </div>

    <% include ../partials/footer %>
  </div>
  <% include ../partials/external %>
</body>
</html>
